package com.littleu.market.controller.v1;

import com.littleu.market.service.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/token")
@Validated
public class TokenController {

    @Autowired
    private ITokenService tokenService;

    @PostMapping("/user")
    public void getUserToken(@RequestBody @Validated String code){
        tokenService.getUserToken(code);
    }
}
